home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / dynCreateClipEffectsLayout.m < prev    next >
Encoding:
Text File  |  2003-07-17  |  40.1 KB  |  1,636 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  July, 1998
  22. //  Author:         Carol Levy
  23. //
  24. //  Description:
  25. //      This script contains code to create the layouts for the
  26. //        dynamics clip effects option boxes (for the Dynamics Effects menus).
  27. //
  28.  
  29. //  ====================== dynCreateClipEffectsLayout ======================
  30. //
  31. //  SYNOPSIS
  32. //      Create a clip effect option box layout.
  33. //
  34. //  INPUT ARGUMENTS
  35. //        string $parent            the parent layout
  36. //        string $theClipEffect    the name of the clip effect to make the layout
  37. //                                for
  38. //
  39. global proc dynCreateClipEffectsLayout(string $parent, string $theClipEffect)
  40. {
  41.     if (!isValidClipEffect($theClipEffect))
  42.         return;
  43.  
  44.     string $procName = ("create"+$theClipEffect+"Layout");
  45.  
  46.     eval(($procName +" "+$parent));
  47. }
  48.  
  49.  
  50. //  ====================== createSmokeLayout ======================
  51. //
  52. //  SYNOPSIS
  53. //      Create a sprite smoke clip effect option box layout.
  54. //
  55. //  INPUT ARGUMENTS
  56. //        string $parent            the parent layout
  57. //
  58. global proc createSmokeLayout( string $parent )
  59. {
  60.     global float $dynMaxFloatField;
  61.     global float $dynMinFloatField;
  62.  
  63.     setParent $parent;
  64.     
  65.     // Sprite Image Name Widget
  66.     //
  67.     textFieldGrp -l "Sprite Image Name" -annotation "Enter the smoke image file name. A default set of images is in the directory Gifts/smoke."
  68.         smokeImageName;
  69.  
  70.     // Smoke Effect Attributes layout
  71.     //
  72.     separator smokeSep1;
  73.     text -l "Smoke Effect Attributes" -al "left" smokeAttrsT;
  74.  
  75.     // Smoke Particle Name Widget
  76.     //
  77.     textFieldGrp -l "Smoke Particle Name"
  78.         smokeParticleName;
  79.  
  80.     checkBoxGrp -l "Cycle Images"
  81.         -ncb 1 -l1 ""
  82.         smokeCycleImages;
  83.  
  84.     intFieldGrp -l "Start Image"
  85.         -nf 1
  86.         smokeStartImage;
  87.  
  88.     intFieldGrp -l "End Image"
  89.         -nf 1
  90.         smokeEndImage;
  91.  
  92.     // Smoke Attributes Controls
  93.     //
  94.     floatSliderGrp -l "Smoke Sprite Min Lifespan"
  95.         -field true 
  96.         -min 0 -max 10
  97.         -fmn 0 -fmx $dynMaxFloatField
  98.         -pre 3 -step 1
  99.         smokeMinLifespan;
  100.  
  101.     floatSliderGrp -l "Smoke Sprite Max Lifespan"
  102.         -field true 
  103.         -min 0 -max 10
  104.         -fmn 0 -fmx $dynMaxFloatField
  105.         -pre 3 -step 1
  106.         smokeMaxLifespan;
  107.  
  108.     floatSliderGrp -l "Smoke Threshold"
  109.         -field true 
  110.         -min 0 -max 1
  111.         -pre 3 -step 0.1
  112.         smokeThreshold;
  113.  
  114.     floatSliderGrp -l "Smoke Opacity"
  115.         -field true 
  116.         -min 0 -max 1
  117.         -pre 3 -step 0.5
  118.         smokeOpacity;
  119.  
  120.     // Smoke Emission Attributes Controls
  121.     //
  122.     separator smokeSep2;
  123.     text -l "Smoke Emission Attributes" -al "left" smokeEmissionAttrsT;
  124.  
  125.     // Smoke Emitter Name Widget
  126.     //
  127.     textFieldGrp -l "Smoke Emitter Name"
  128.         smokeEmitterName;
  129.  
  130.     floatSliderGrp -l "Smoke Emission Rate"
  131.         -field true 
  132.         -min 0 -max 500
  133.         -fmn 0 -fmx $dynMaxFloatField
  134.         -pre 3 -step 10
  135.         smokeEmissionRate;
  136.  
  137.     floatSliderGrp -label "DirectionX"
  138.         -field true
  139.         -min -10 -max 10
  140.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  141.         -pre 3 -step 0.5
  142.         smokeEmissionDirX;
  143.  
  144.     floatSliderGrp -label "DirectionY"
  145.         -field true
  146.         -min -10 -max 10
  147.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  148.         -pre 3 -step 0.5
  149.         smokeEmissionDirY;
  150.  
  151.     floatSliderGrp -label "DirectionZ"
  152.         -field true
  153.         -min -10 -max 10
  154.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  155.         -pre 3 -step 0.5
  156.         smokeEmissionDirZ;
  157.  
  158.     floatSliderGrp -l "Smoke Emission Spread"
  159.         -field true 
  160.         -min 0 -max 1
  161.         -pre 3 -step 0.1
  162.         smokeEmissionSpread;
  163.  
  164.     floatSliderGrp -l "Smoke Emission Speed"
  165.         -field true 
  166.         -min 0 -max  10
  167.         -fmn 0 -fmx $dynMaxFloatField
  168.         -pre 3 -step 0.1
  169.         smokeEmissionSpeed;
  170.  
  171.     // Smoke Motion Attributes Controls.
  172.     //
  173.     separator smokeSep3;
  174.     text -l "Smoke Motion Attributes" -al "left" smokeMotionAttrsT;
  175.  
  176.     checkBoxGrp -l "Motion Forces"
  177.         -ncb 1 
  178.         -l1 "Turbulence"
  179.         -on1 "dynEnableTurbulenceCB 1"
  180.         -of1 "dynEnableTurbulenceCB 0"
  181.         smokeMotionForces;
  182.  
  183.     // Turbulence Attribute Controls.
  184.     //
  185.     text -l "Turbulence Attributes" -al "left" smokeTurbAttrsT;
  186.     
  187.     // Smoke Turbulence Name Widget
  188.     //
  189.     textFieldGrp -l "Smoke Turbulence Name"
  190.         smokeTurbulenceName;
  191.  
  192.     floatSliderGrp -l "Turbulence Magnitude"
  193.         -field true 
  194.         -min 0 -max  100
  195.         -fmn 0 -fmx $dynMaxFloatField
  196.         -pre 3 -step 0.5
  197.         smokeTurbulenceMagnitude;
  198.  
  199.     floatSliderGrp -l "Turbulence Frequency"
  200.         -field true 
  201.         -min 0 -max  100
  202.         -fmn 0 -fmx $dynMaxFloatField
  203.         -pre 3 -step 0.5
  204.         smokeTurbulenceFrequency;
  205.  
  206.     floatSliderGrp -l "Turbulence Attenuation"
  207.         -field true 
  208.         -min 0 -max  10
  209.         -fmn 0 -fmx $dynMaxFloatField
  210.         -pre 3 -step 0.1
  211.         smokeTurbulenceAttenuation;
  212.  
  213.     setParent ..; 
  214.     setParent ..; 
  215. }
  216.  
  217. //  ====================== createFireLayout ======================
  218. //
  219. //  SYNOPSIS
  220. //      Create a fire clip effect option box layout.
  221. //
  222. //  INPUT ARGUMENTS
  223. //        string $parent            the parent layout
  224. //
  225. global proc createFireLayout( string $parent )
  226. {
  227.     global float $dynMaxFloatField;
  228.     global float $dynMinFloatField;
  229.  
  230.     setParent $parent;
  231.     
  232.     // Fire Effect Attributes layout
  233.     //
  234.     separator fireSep1;
  235.     text -l "Fire Attributes" -al "left" fireEffectAttrsT;
  236.  
  237.     textFieldGrp -l "Object On Fire"
  238.         fireObject;
  239.  
  240.     textFieldGrp -l "Fire Particle Name"
  241.         fireParticleName;
  242.  
  243.     separator fireSep2;
  244.     text -l "Fire Attributes" -al "left" fireAttrsT;
  245.  
  246.     // Emitter Types Option Menu
  247.     //
  248.     optionMenuGrp -l "Fire Emitter Type:"
  249.         -cc ("dynClipEffectsEmitterOptionChoice " + $parent)
  250.         fireEmissionTypeOM;
  251.         menuItem -l "Omni-directional Point" emitterOmniPoint;
  252.         menuItem -l "Directional Point" emitterDirPoint;
  253.         menuItem -l "Surface" emitterSurface;
  254.         menuItem -l "Curve" emitterCurve;
  255.  
  256.     // Fire Attributes Controls
  257.     //
  258.     floatSliderGrp -l "Fire Density"
  259.         -field true 
  260.         -min 0 -max 100
  261.         -fmn 0 -fmx $dynMaxFloatField
  262.         -pre 3 -step 10
  263.         fireDensity;
  264.  
  265.     floatSliderGrp -l "Flame Start Radius"
  266.         -field true 
  267.         -min 0 -max 10
  268.         -fmn 0 -fmx $dynMaxFloatField
  269.         -pre 3 -step .1
  270.         fireStartRadius;
  271.  
  272.     floatSliderGrp -l "Flame End Radius"
  273.         -field true 
  274.         -min 0 -max 10
  275.         -fmn 0 -fmx $dynMaxFloatField
  276.         -pre 3 -step .1
  277.         fireEndRadius;
  278.  
  279.     floatSliderGrp -l "Fire Intensity"
  280.         -field true 
  281.         -min 0 -max 1
  282.         -pre 3 -step .1
  283.         fireIntensity;
  284.  
  285.     floatSliderGrp -l "Fire Spread"
  286.         -field true 
  287.         -min 0 -max 1
  288.         -pre 3 -step 0.1
  289.         fireSpread;
  290.  
  291.     floatSliderGrp -l "Fire Speed"
  292.         -field true 
  293.         -min 0 -max  100
  294.         -fmn 0 -fmx $dynMaxFloatField
  295.         -pre 3 -step 0.5
  296.         fireSpeed;
  297.  
  298.     // Fire direction controls.
  299.     //
  300.     floatSliderGrp -label "Fire Direction X"
  301.         -field true
  302.         -min -10 -max 10
  303.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  304.         -pre 3 -step 0.5
  305.         fireDirectionX;
  306.  
  307.     floatSliderGrp -label "Fire Direction Y"
  308.         -field true
  309.         -min -10 -max 10
  310.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  311.         -pre 3 -step 0.5
  312.         fireDirectionY;
  313.  
  314.     floatSliderGrp -label "Fire Direction Z"
  315.         -field true
  316.         -min -10 -max 10
  317.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  318.         -pre 3 -step 0.5
  319.         fireDirectionZ;
  320.  
  321.     floatSliderGrp -l "Fire Turbulence"
  322.         -field true 
  323.         -min 0 -max  500
  324.         -fmn 0 -fmx $dynMaxFloatField
  325.         -pre 3 -step 0.5
  326.         fireTurbulence;
  327.  
  328.     floatSliderGrp -l "Fire Scale"
  329.         -field true 
  330.         -min 0 -max  10
  331.         -fmn 0 -fmx $dynMaxFloatField
  332.         -pre 3 -step 0.1
  333.         fireScale;
  334.  
  335.     setParent ..; 
  336.     setParent ..; 
  337.  
  338. }
  339.  
  340.  
  341. //  ====================== createFlowLayout ======================
  342. //
  343. //  SYNOPSIS
  344. //      Create a flow-along-curves clip effect option box layout.
  345. //
  346. //  INPUT ARGUMENTS
  347. //        string $parent            the parent layout
  348. //
  349. global proc createFlowLayout( string $parent )
  350. {
  351.     global float $dynMaxFloatField;
  352.     global float $dynMinFloatField;
  353.  
  354.     setParent $parent;
  355.     
  356.     // Flow Along Curves Effect Attributes layout
  357.     //
  358.     separator flowSep1;
  359.     text -l "Flow Along Curves" -al "left" flowEffectAttrsT;
  360.  
  361.     textFieldGrp -l "Flow Group Name"
  362.         flowObject;
  363.  
  364.     separator flowSep2;
  365.     text -l "Flow Creation Controls" -al "left" flowCreateControlT;
  366.  
  367.     // Flow Creation Controls
  368.     //
  369.  
  370.     checkBoxGrp -l "Attach Emitter to Curve"
  371.         -ncb 1 
  372.         -l1 ""
  373.         flowAttachEmitter;
  374.  
  375.     intSliderGrp -l "Num Control Segments"
  376.         -field true 
  377.         -min 0 -max 100
  378.         -fmn 0 -fmx $dynMaxFloatField
  379.         -sliderStep 1
  380.         flowNumControlSegs;
  381.  
  382.     intSliderGrp -l "Num Control Subsegments"
  383.         -field true 
  384.         -min 0 -max 100
  385.         -fmn 0 -fmx $dynMaxFloatField
  386.         -sliderStep 1
  387.         flowNumControlSubsegs;
  388.  
  389.     separator flowSep3;
  390.     text -l "Flow Attribute Controls" -al "left" flowAttrsT;
  391.  
  392.     floatSliderGrp -l "Emission Rate"
  393.         -field true 
  394.         -min 0 -max 100
  395.         -fmn 0 -fmx $dynMaxFloatField
  396.         -pre 3 -step 1
  397.         flowEmitterRate;
  398.  
  399.     // Flow random motion factor
  400.     //
  401.     floatSliderGrp -label "Random Motion Speed"
  402.         -field true
  403.         -min 0 -max 10
  404.         -fmn 0 -fmx $dynMaxFloatField
  405.         -pre 3 -step 1
  406.         flowRandomMotion;
  407.  
  408.     floatSliderGrp -label "Particle Lifespan"
  409.         -field true
  410.         -min 0 -max 100
  411.         -fmn 0 -fmx $dynMaxFloatField
  412.         -pre 3 -step 0.1
  413.         flowLifespan;
  414.  
  415.     floatSliderGrp -label "Goal Weight"
  416.         -field true
  417.         -min 0 -max 1
  418.         -pre 3 -step 0.1
  419.         flowGoalWeight;
  420.  
  421.     setParent ..; 
  422.     setParent ..; 
  423.  
  424. }
  425.  
  426.  
  427. //  ====================== createSurfaceFlowLayout ======================
  428. //
  429. //  SYNOPSIS
  430. //      Create a flow-along-surface clip effect option box layout.
  431. //
  432. //  INPUT ARGUMENTS
  433. //        string $parent            the parent layout
  434. //
  435. global proc createSurfaceFlowLayout( string $parent )
  436. {
  437.     global float $dynMaxFloatField;
  438.     global float $dynMinFloatField;
  439.  
  440.     setParent $parent;
  441.  
  442.     // Flow Along Curves Effect Attributes layout
  443.     //
  444.     separator surfaceFlowSep1;
  445.     text -l "Flow Along Surface" -al "left" surfaceFlowEffectAttrsT;
  446.  
  447.     textFieldGrp -l "Flow Group Name" surfaceFlowObject;
  448.  
  449.     separator surfaceFlowSep2;
  450.     text -l "Flow Creation Controls" -al "left" surfaceFlowCreateControlT;
  451.  
  452.     // Flow Creation Controls
  453.     //
  454.     checkBoxGrp -l "Create Particle"
  455.         -ncb 1 
  456.         -l1 ""
  457.         surfaceFlowCreateParticle;
  458.     checkBoxGrp -l "Create Particle Per Flow"
  459.         -ncb 1 
  460.         -l1 ""
  461.         surfaceFlowCreateParticleForEachFlow;
  462.  
  463.     optionMenuGrp -l "Manipulators Along" -enable true surfaceFlowManipType;
  464.     string $u = "u";
  465.     string $v = "v";
  466.     string $minU;
  467.     string $minV;
  468.     if (`about -mac`){
  469.         //    On Macintosh
  470.         //    if the menuItem label starts with a '-', 
  471.         //    then it is interpreted as a 'Menu-Separator'.
  472.         //    Therefore changing '-u' to 'minusU' and '-v' to 'minusV'
  473.         //    This is a serious limitation...
  474.         $minU = "minusU";
  475.         $minV = "minusV";
  476.     }
  477.     else{
  478.         $minU = "-u";
  479.         $minV = "-v";
  480.     }
  481.     menuItem -l $u surfaceFlowManipTypeU;
  482.     menuItem -l $minU surfaceFlowManipTypeU2;
  483.     menuItem -l $v surfaceFlowManipTypeV;
  484.     menuItem -l $minV surfaceFlowManipTypeV2;
  485.     // setParent -m ..;
  486.  
  487.     intSliderGrp -l "Control Resolution"
  488.         -field true
  489.         -min 2 -max 100
  490.         -fmn 0 -fmx $dynMaxFloatField
  491.         -sliderStep 1
  492.         surfaceFlowControlResolution;
  493.  
  494.     intSliderGrp -l "Sub-Control Resolution"
  495.         -field true
  496.         -min 0 -max 100
  497.         -fmn 0 -fmx $dynMaxFloatField
  498.         -sliderStep 1
  499.         surfaceFlowSubControlResolution;
  500.  
  501.     intSliderGrp -l "Manipulator Resolution"
  502.         -field true
  503.         -min 3 -max 20
  504.         -fmn 0 -fmx $dynMaxFloatField
  505.         -sliderStep 1
  506.         surfaceFlowManipulatorResolution;
  507.  
  508.     separator surfaceFlowSep3;
  509.     text -l "Flow Attribute Controls" -al "left" surfaceFlowAttrsT;
  510.  
  511.     floatSliderGrp -l "Emission Rate"
  512.         -field true
  513.         -min 0 -max 100
  514.         -fmn 0 -fmx $dynMaxFloatField
  515.         -pre 3 -step 1
  516.         surfaceFlowEmitterRate;
  517.  
  518.     floatSliderGrp -l "Particle Lifespan"
  519.         -field true
  520.         -min 0 -max 100
  521.         -fmn 0 -fmx $dynMaxFloatField
  522.         -pre 3 -step 1
  523.         surfaceFlowParticleLifespan;
  524.  
  525.     floatSliderGrp -label "Goal Weight"
  526.         -field true
  527.         -min 0 -max 1
  528.         -pre 3 -step 0.1
  529.         surfaceFlowGoalWeight;
  530.  
  531.     floatSliderGrp -label "Min Age Ratio"
  532.         -field true
  533.         -min 0 -max 1
  534.         -pre 3 -step 0.1
  535.         surfaceFlowMinAgeRatio;
  536.  
  537.     floatSliderGrp -label "Max Age Ratio"
  538.         -field true
  539.         -min 0 -max 1
  540.         -pre 3 -step 0.1
  541.         surfaceFlowMaxAgeRatio;
  542.  
  543.     setParent ..; 
  544.     setParent ..; 
  545. }
  546.  
  547.  
  548. //  ====================== createDeleteSurfaceFlowLayout ======================
  549. //
  550. //  SYNOPSIS
  551. //      Create a delete-surface-flow effect option box layout.
  552. //
  553. //  INPUT ARGUMENTS
  554. //        string $parent            the parent layout
  555. //
  556. global proc createDeleteSurfaceFlowLayout( string $parent )
  557. {
  558.     setParent $parent;
  559.  
  560.     separator deleteSurfaceFlowSep1;
  561.     text -l "Flow Deletion Controls:" -al "left" surfaceFlowDeleteControlT;
  562.  
  563.     // Deletion Controls
  564.     //
  565.     radioButtonGrp -l ""
  566.         -nrb 1
  567.         -cal 1 "left"
  568.         -l1 "Delete Surface Flow Groups"
  569.         -cc1 ("deleteSurfaceFlowParticlesCB 1")
  570.         deleteSurfaceFlow;
  571.     radioButtonGrp -l ""
  572.         -nrb 1
  573.         -cal 1 "left"
  574.         -shareCollection deleteSurfaceFlow
  575.         -l1 "Remove Particles From Surface Flow"
  576.         -cc1 ("deleteSurfaceFlowParticlesCB 0")
  577.         removeParticlesFromSurfaceFlow;
  578.  
  579.     checkBoxGrp -l ""
  580.         -ncb 1
  581.         -cal 1 "left"
  582.         -l1 "Delete Surface Flow Particles"
  583.         deleteSurfaceFlowParticles;
  584.  
  585.     setParent ..;
  586.     setParent ..;
  587. }
  588.  
  589.  
  590. //  ====================== createLightningLayout ======================
  591. //
  592. //  SYNOPSIS
  593. //      Create a lightning clip effect option box layout.
  594. //
  595. //  INPUT ARGUMENTS
  596. //        string $parent            the parent layout
  597. //
  598. global proc createLightningLayout( string $parent )
  599. {
  600.     global float $dynMaxFloatField;
  601.     global float $dynMinFloatField;
  602.  
  603.     setParent $parent;
  604.  
  605.     // Flow Along Curves Effect Attributes layout
  606.     //
  607.     separator lightningFlowSep1;
  608.     text -l "Lightning" -al "left" lightningEffectAttrsT;
  609.  
  610.     textFieldGrp -l "Lightning Name" lightningObject;
  611.  
  612.     separator lightningFlowSep2;
  613.     text -l "Lightning Creation Controls" -al "left" lightningCreateControlT;
  614.  
  615.     // Lightning Creation Controls
  616.     //
  617.     checkBoxGrp -l "Group Lightnings"
  618.         -ncb 1 
  619.         -l1 ""
  620.         lightningGrouping;
  621.  
  622.     radioButtonGrp -l "Creation Options"
  623.         -nrb 3
  624.         -cal 1 "left"
  625.         -l1 "All"
  626.         -l2 "In Order"
  627.         -l3 "From First"
  628.         lightningCreateOptions;
  629.  
  630.     intSliderGrp -l "Curve Segments"
  631.         -field true
  632.         -min 5 -max 100
  633.         -fmn 5 -fmx $dynMaxFloatField
  634.         -sliderStep 1
  635.         lightningCurveSegments;
  636.  
  637.     separator lightningFlowSep3;
  638.     text -l "Lightning Attribute Controls" -al "left" lightningAttrsT;
  639.  
  640.     floatSliderGrp -l "Thickness"
  641.         -field true
  642.         -min 0 -max 100
  643.         -fmn 0 -fmx $dynMaxFloatField
  644.         -pre 3 -step 1
  645.         lightningThickness;
  646.  
  647.     floatSliderGrp -l "Max Spread"
  648.         -field true
  649.         -min 0 -max 100
  650.         -fmn 0 -fmx $dynMaxFloatField
  651.         -pre 3 -step 1
  652.         lightningMaxSpread;
  653.  
  654.     floatSliderGrp -l "Lightning Start"
  655.         -field true
  656.         -min 0 -max 100
  657.         -fmn 0 -fmx $dynMaxFloatField
  658.         -pre 3 -step 1
  659.         lightningStart;
  660.  
  661.     floatSliderGrp -l "Lightning End"
  662.         -field true
  663.         -min 0 -max 100
  664.         -fmn 0 -fmx $dynMaxFloatField
  665.         -pre 3 -step 1
  666.         lightningEnd;
  667.  
  668.     floatSliderGrp -l "Lightning Glow Intensity"
  669.         -field true
  670.         -min 0 -max 100
  671.         -fmn 0 -fmx $dynMaxFloatField
  672.         -pre 3 -step 1
  673.         lightningGlowIntensity;
  674.  
  675.     setParent ..; 
  676.     setParent ..; 
  677. }
  678.  
  679.  
  680. global proc deleteSurfaceFlowParticlesCB( int $enable )
  681. {
  682.     checkBoxGrp -e -enable $enable deleteSurfaceFlowParticles;
  683. }
  684.  
  685.  
  686. // ===================   INTERNAL CONTROL CALLBACKS ===============
  687. //
  688. //
  689. //    Callback for the smoke Use turbulence checkbox.
  690. //
  691. global proc dynEnableTurbulenceCB(int $isTurbulenceOn)
  692. {
  693.     if ($isTurbulenceOn)
  694.     {
  695.         textFieldGrp -e -enable true smokeTurbulenceName;
  696.         floatSliderGrp -e -enable true smokeTurbulenceMagnitude;
  697.         floatSliderGrp -e -enable true smokeTurbulenceFrequency;
  698.         floatSliderGrp -e -enable true smokeTurbulenceAttenuation;
  699.     }
  700.     else
  701.     {
  702.         textFieldGrp -e -enable false smokeTurbulenceName;
  703.         floatSliderGrp -e -enable false smokeTurbulenceMagnitude;
  704.         floatSliderGrp -e -enable false smokeTurbulenceFrequency;
  705.         floatSliderGrp -e -enable false smokeTurbulenceAttenuation;
  706.     }
  707. }
  708.  
  709.  
  710. // Callback for the fire emitter option menu.
  711. // Set fire spread "on" for all but the omni emitter type.
  712. //
  713. global proc dynClipEffectsEmitterOptionChoice(string $parent)
  714. {
  715.     setParent $parent;
  716.     int     $choice = `optionMenuGrp -q -sl fireEmissionTypeOM`;
  717.  
  718.     if ($choice == 1 || $choice == 3)
  719.     {
  720.         // Omni Point and Surface
  721.         //
  722.         floatSliderGrp -e -enable false fireSpread;
  723.     }
  724.     else 
  725.     {
  726.         // Directional Point and Curve
  727.         //
  728.         floatSliderGrp -e -enable true fireSpread;
  729.     }
  730. }
  731.  
  732.  
  733. //    Callback for the melt Use resolution control.
  734. //
  735. global proc dynEnableLatticeResCB(string $parent, int $isOn)
  736. {
  737.     setParent $parent;
  738.     if ($isOn)
  739.     {
  740.         floatSliderGrp -e -enable true meltLatticeResX;
  741.         floatSliderGrp -e -enable true meltLatticeResY;
  742.         floatSliderGrp -e -enable true meltLatticeResZ;
  743.     }
  744.     else
  745.     {
  746.         floatSliderGrp -e -enable false meltLatticeResX;
  747.         floatSliderGrp -e -enable false meltLatticeResY;
  748.         floatSliderGrp -e -enable false meltLatticeResZ;
  749.     }
  750. }
  751.  
  752.  
  753. //  ====================== createMeltLayout ======================
  754. //
  755. //  SYNOPSIS
  756. //      Create a melt clip effect option box layout.
  757. //
  758. //  INPUT ARGUMENTS
  759. //        string $parent            the parent layout
  760. //
  761. global proc createMeltLayout( string $parent )
  762. {
  763.     global float $dynMaxFloatField;
  764.     global float $dynMinFloatField;
  765.  
  766.     setParent $parent;
  767.     
  768.     // Melt Effect Attributes layout
  769.     //
  770.     separator meltSep1;
  771.     text -l "Melt Attributes" -al "left" meltEffectAttrsT;
  772.  
  773.     textFieldGrp -l "Object to Melt"
  774.         meltObject;
  775.  
  776.     textFieldGrp -l "Melt-on Object"
  777.         meltOnObject;
  778.  
  779.     separator meltSep2;
  780.     text -l "Melt Attributes" -al "left" meltAttrsT;
  781.  
  782.     // Melt Attributes Controls
  783.     //
  784.     floatSliderGrp -l "Melt Speed"
  785.         -field true 
  786.         -min 0 -max 10
  787.         -fmn 0 -fmx 1000
  788.         -pre 3 -step .5
  789.         meltSpeed;
  790.  
  791.     floatSliderGrp -l "Melt Spread"
  792.         -field true 
  793.         -min 0 -max 10
  794.         -fmn 0 -fmx 1000
  795.         -pre 3 -step 1
  796.         meltSpread;
  797.  
  798.     floatSliderGrp -l "Melt Distortion"
  799.         -field true 
  800.         -min 0 -max 10
  801.         -fmn 0 -fmx 1000
  802.         -pre 3 -step 1
  803.         meltDistortion;
  804.  
  805.     // Melt direction controls.
  806.     //
  807.     floatSliderGrp -label "Melt Direction X"
  808.         -field true
  809.         -min -1 -max 1
  810.         -pre 3 -step 0.1
  811.         meltDirectionX;
  812.  
  813.     floatSliderGrp -label "Melt Direction Y"
  814.         -field true
  815.         -min -1 -max 1
  816.         -pre 3 -step 0.1
  817.         meltDirectionY;
  818.  
  819.     floatSliderGrp -label "Melt Direction Z"
  820.         -field true
  821.         -min -1 -max 1
  822.         -pre 3 -step 0.1
  823.         meltDirectionZ;
  824.  
  825.     // Melt control resolution.
  826.     //
  827.     checkBoxGrp -l "Use Resolution Control"
  828.         -ncb 1 
  829.         -l1 ""
  830.         -on1 ("dynEnableLatticeResCB " + $parent + " 1")
  831.         -of1 ("dynEnableLatticeResCB " + $parent + " 0")
  832.         meltUseLatticeRes;
  833.  
  834.     floatSliderGrp -label "Control Resolution X"
  835.         -field true
  836.         -min 2 -max 100
  837.         -pre 0 -step 1
  838.         meltLatticeResX;
  839.  
  840.     floatSliderGrp -label "Control Resolution Y"
  841.         -field true
  842.         -min 2 -max 100
  843.         -pre 0 -step 1
  844.         meltLatticeResY;
  845.  
  846.     floatSliderGrp -label "Control Resolution Z"
  847.         -field true
  848.         -min 2 -max 100
  849.         -pre 0 -step 1
  850.         meltLatticeResZ;
  851.  
  852.     setParent ..; 
  853.     setParent ..; 
  854.  
  855. }
  856.  
  857.  
  858. //  ====================== createFireworksLayout ======================
  859. //
  860. //  SYNOPSIS
  861. //      Create a fireworks clip effect option box layout.
  862. //
  863. //  INPUT ARGUMENTS
  864. //        string $parent            the parent layout
  865. //
  866. global proc createFireworksLayout( string $parent )
  867. {
  868.     global float $dynMaxFloatField;
  869.     global float $dynMinFloatField;
  870.  
  871.     setParent $parent;
  872.     
  873.     textFieldGrp -l "Fireworks Name" fireworksName;
  874.  
  875.     //  Rocket Attributes layout
  876.     //
  877.     frameLayout -l "Rocket Attributes"
  878.         -bv true -lv true -cll true -cl false -mh 4
  879.         fwRocketAttrsF;
  880.     columnLayout fwRocketAttrsC;
  881.  
  882.     // Controls for fireworks rockets
  883.     //
  884.     intSliderGrp -l "Num Rockets"
  885.         -field true 
  886.         -min 0 -max 100
  887.         -fmn 0 -fmx $dynMaxFloatField
  888.         -sliderStep 1
  889.         fwNumRockets;
  890.  
  891.     floatSliderGrp -label "Launch Position X"
  892.         -field true
  893.         -min -100 -max 100
  894.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  895.         -pre 3 -step 1
  896.         fwLaunchPositionX;
  897.  
  898.     floatSliderGrp -label "Launch Position Y"
  899.         -field true
  900.         -min -100 -max 100
  901.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  902.         -pre 3 -step 1
  903.         fwLaunchPositionY;
  904.  
  905.     floatSliderGrp -label "Launch Position Z"
  906.         -field true
  907.         -min -100 -max 100
  908.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  909.         -pre 3 -step 1
  910.         fwLaunchPositionZ;
  911.  
  912.     floatSliderGrp -label "Burst Position Center X"
  913.         -field true
  914.         -min -100 -max 100
  915.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  916.         -pre 3 -step 1
  917.         fwBurstPosCenterX;
  918.  
  919.     floatSliderGrp -label "Burst Position Center Y"
  920.         -field true
  921.         -min -100 -max 100
  922.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  923.         -pre 3 -step 1
  924.         fwBurstPosCenterY;
  925.  
  926.     floatSliderGrp -label "Burst Position Center Z"
  927.         -field true
  928.         -min -100 -max 100
  929.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  930.         -pre 3 -step 1
  931.         fwBurstPosCenterZ;
  932.  
  933.     floatSliderGrp -label "Burst Position Extents X"
  934.         -field true
  935.         -min -100 -max 100
  936.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  937.         -pre 3 -step 1
  938.         fwBurstExtentsX;
  939.  
  940.     floatSliderGrp -label "Burst Position Extents Y"
  941.         -field true
  942.         -min -100 -max 100
  943.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  944.         -pre 3 -step 1
  945.         fwBurstExtentsY;
  946.  
  947.     floatSliderGrp -label "Burst Position Extents Z"
  948.         -field true
  949.         -min -100 -max 100
  950.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  951.         -pre 3 -step 1
  952.         fwBurstExtentsZ;
  953.  
  954.     floatSliderGrp -label "First Launch Frame"
  955.         -field true
  956.         -min 0 -max 100
  957.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  958.         -pre 3 -step 1
  959.         fwFirstLaunchFrame;
  960.  
  961.     floatSliderGrp -label "Launch Rate (Per Frame)"
  962.         -field true
  963.         -min 0 -max 100
  964.         -fmn 0 -fmx $dynMaxFloatField
  965.         -pre 3 -step 1
  966.         fwLaunchRate;
  967.  
  968.     floatSliderGrp -label "Min Flight Time (Frames)"
  969.         -field true
  970.         -min 0 -max 100
  971.         -fmn 0 -fmx $dynMaxFloatField
  972.         -pre 3 -step 1
  973.         fwMinFlightTime;
  974.  
  975.     floatSliderGrp -label "Max Flight Time (Frames)"
  976.         -field true
  977.         -min 0 -max 100
  978.         -fmn 0 -fmx $dynMaxFloatField
  979.         -pre 3 -step 1
  980.         fwMaxFlightTime;
  981.  
  982.     floatSliderGrp -label "Max Burst Speed" 
  983.         -field true
  984.         -min 0 -max 100
  985.         -fmn 0 -fmx $dynMaxFloatField
  986.         -pre 3 -step 10
  987.         fwMaxBurstSpeed;
  988.  
  989.     setParent ..;
  990.     setParent ..;
  991.  
  992.     //  Rocket Trail Sparks Attributes layout
  993.     //
  994.     frameLayout -l "Rocket Trail Attributes"
  995.         -bv true -lv true -cll true -cl true -mh 4
  996.         fwRocketTrailAttrsF;
  997.     columnLayout fwRocketTrailAttrsC;
  998.  
  999.     floatSliderGrp -label "Emission Rate"
  1000.         -field true
  1001.         -min 0 -max 500
  1002.         -fmn 0 -fmx $dynMaxFloatField
  1003.         -pre 3 -step 10
  1004.         fwTrailRate;
  1005.  
  1006.     floatSliderGrp -label "Emission Speed"
  1007.         -field true
  1008.         -min 0 -max 100
  1009.         -pre 3 -step 1
  1010.         fwTrailSpeed;
  1011.  
  1012.     floatSliderGrp -label "Emission Spread"
  1013.         -field true
  1014.         -min 0 -max 1
  1015.         -pre 3 -step .1
  1016.         fwTrailSpread;
  1017.  
  1018.     floatSliderGrp -label "Min Tail Size"
  1019.         -field true
  1020.         -min 0 -max 10
  1021.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  1022.         -pre 3 -step 1
  1023.         fwMinTrailTailSize;
  1024.  
  1025.     floatSliderGrp -label "Max Tail Size"
  1026.         -field true
  1027.         -min 0 -max 10
  1028.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  1029.         -pre 3 -step 1
  1030.         fwMaxTrailTailSize;
  1031.  
  1032.     //  Rocket Trail Colors layout
  1033.     //
  1034.     separator;
  1035.     text -l "Rocket Trail Color Attributes" -al "left" fwRockeTrailColorsAttrsT;
  1036.  
  1037.     checkBoxGrp -l "Set Color Creation Proc"
  1038.         -ncb 1 -v1 0 -l1 ""
  1039.         -on1 ("fwTrailSetUserColorProcCB " + $parent + " 1")
  1040.         -of1 ("fwTrailSetUserColorProcCB " + $parent + " 0")
  1041.         fwTrailSetUserColor;
  1042.  
  1043.     textFieldGrp -l "Color Creation Proc"
  1044.         fwTrailColorCreationProc;
  1045.  
  1046.     intSliderGrp -l "Num Trail Colors"
  1047.         -field true 
  1048.         -min 0 -max 100
  1049.         -fmn 0 -fmx $dynMaxFloatField
  1050.         -sliderStep 1
  1051.         fwTrailNumColors;
  1052.  
  1053.  
  1054.     floatSliderGrp -label "Glow Intensity"
  1055.         -field true
  1056.         -min 0 -max 1
  1057.         -pre 3 -step .1
  1058.         fwTrailGlowIntensity;
  1059.  
  1060.     floatSliderGrp -label "Incandescence Intensity"
  1061.         -field true
  1062.         -min 0 -max 1
  1063.         -pre 3 -step .1
  1064.         fwTrailIncanIntensity;
  1065.  
  1066.     setParent ..;
  1067.     setParent ..;
  1068.  
  1069.     //  Rocket Burst Sparks layout
  1070.     //
  1071.     frameLayout -l "Fireworks Sparks Attributes"
  1072.         -bv true -lv true -cll true -cl true -mh 4
  1073.         fwBurstAttrsF;
  1074.     columnLayout fwBurstAttrsC;
  1075.  
  1076.     floatSliderGrp -label "Min Sparks Count"
  1077.         -field true
  1078.         -min 0 -max 100
  1079.         -fmn 0 -fmx $dynMaxFloatField
  1080.         -pre 3 -step 10
  1081.         fwMinSparksCount;
  1082.  
  1083.     floatSliderGrp -label "Max Sparks Count"
  1084.         -field true
  1085.         -min 0 -max 500
  1086.         -fmn 0 -fmx $dynMaxFloatField
  1087.         -pre 3 -step 10
  1088.         fwMaxSparksCount;
  1089.  
  1090.     floatSliderGrp -label "Min Tail Size"
  1091.         -field true
  1092.         -min 0 -max 100
  1093.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  1094.         -pre 3 -step 1
  1095.         fwMinSparksTailSize;
  1096.  
  1097.     floatSliderGrp -label "Max Tail Size"
  1098.         -field true
  1099.         -min 0 -max 100
  1100.         -fmn $dynMinFloatField -fmx $dynMaxFloatField
  1101.         -pre 3 -step 1
  1102.         fwMaxSparksTailSize;
  1103.  
  1104.  
  1105.     //  Fireworks Sparks Colors layout
  1106.     //
  1107.     separator;
  1108.     text -l "Fireworks Colors Attributes" -al "left" fwColorsAttrsT;
  1109.  
  1110.     checkBoxGrp -l "Set Color Creation Proc"
  1111.         -ncb 1 -v1 0 -l1 ""
  1112.         -on1 ("fwSparksSetUserColorProcCB " + $parent + " 1")
  1113.         -of1 ("fwSparksSetUserColorProcCB " + $parent + " 0")
  1114.         fwSparksSetUserColor;
  1115.  
  1116.     textFieldGrp -l "Color Creation Proc"
  1117.         fwSparksColorCreationProc;
  1118.  
  1119.     intSliderGrp -l "Num Spark Colors"
  1120.         -field true 
  1121.         -min 0 -max 100
  1122.         -fmn 0 -fmx $dynMaxFloatField
  1123.         -sliderStep 1
  1124.         fwSparksNumColors;
  1125.  
  1126.     intSliderGrp -l "Sparks Color Spread"
  1127.         -field true 
  1128.         -min 0 -max 10
  1129.         -fmn 0 -fmx $dynMaxFloatField
  1130.         -sliderStep 1
  1131.         fwSparksColorSpread;
  1132.  
  1133.     floatSliderGrp -label "Glow Intensity"
  1134.         -field true
  1135.         -min 0 -max 1
  1136.         -pre 3 -step .1
  1137.         fwSparksGlowIntensity;
  1138.  
  1139.     floatSliderGrp -label "Incandescence Intensity"
  1140.         -field true
  1141.         -min 0 -max 1
  1142.         -pre 3 -step .1
  1143.         fwSparksIncanIntensity;
  1144. }
  1145.  
  1146.  
  1147. //  ====================== createShatterLayout ======================
  1148. //
  1149. //  SYNOPSIS
  1150. //      Create a shatter clip effect option box layout.
  1151. //
  1152. //  INPUT ARGUMENTS
  1153. //        string $parent            the parent layout
  1154. //
  1155. global proc createShatterLayout( string $parent )
  1156. {
  1157.     setParent $parent;
  1158.     
  1159.     string $form = `formLayout`;
  1160.     string $tabs = `tabLayout -cc ("dynClipEffectsShatterTabCB " + $parent) -width 200 -innerMarginWidth 5 -innerMarginHeight 5 shatterTabLayout`;
  1161.  
  1162.     formLayout -edit -attachForm $tabs "top" 0
  1163.         -attachForm $tabs "left" 0
  1164.         -attachForm $tabs "bottom" 0
  1165.         -attachForm $tabs "right" 0
  1166.         $form;
  1167.  
  1168.     string $surfaceTab = createSurfaceShatterTabLayout( $parent );
  1169.     string $solidTab   = createSolidShatterTabLayout( $parent );
  1170.     string $crackTab   = createCrackShatterTabLayout( $parent );
  1171.  
  1172.     tabLayout -edit -tabLabel $surfaceTab "Surface Shatter" 
  1173.                     -tabLabel $solidTab   "Solid Shatter" 
  1174.                     -tabLabel $crackTab   "Crack Shatter" $tabs;
  1175.  
  1176.     string $shatterTypeValue = `tabLayout -q -selectTab shatterTabLayout`;
  1177.  
  1178.     setParent ..; 
  1179.     setParent ..; 
  1180. }
  1181.  
  1182. //  ====================== createSurfaceShatterTabLayout ======================
  1183. //
  1184. //  SYNOPSIS
  1185. //      Create a surface shatter clip effect option box layout.
  1186. //
  1187. //  INPUT ARGUMENTS
  1188. //        string $parent            the parent layout
  1189. //
  1190. global proc string createSurfaceShatterTabLayout( string $parent )
  1191. {
  1192.     string $surfaceTab = `rowColumnLayout -numberOfColumns 1 -cw 1 700 shatterSurfaceTab`;
  1193.  
  1194.     textFieldGrp -l "Surface Shatter Name" 
  1195.         shatterSurfaceName;
  1196.  
  1197.     // Shatter Attributes Controls
  1198.     //
  1199.     intSliderGrp -l "Shard Count"
  1200.         -field true 
  1201.         -min 2 -max 10
  1202.         -fmx  10000
  1203.         -step 1
  1204.         shatterSurfaceShardCount;
  1205.  
  1206.     floatSliderGrp -l "Extrude Shards"
  1207.         -field true 
  1208.         -min -1.0
  1209.         -max  1.0
  1210.         -fmn -10000.0
  1211.         -fmx  10000.0
  1212.         -step 1
  1213.         shatterSurfaceExtrude;
  1214.  
  1215.     intSliderGrp -l "Seed Value"
  1216.         -field true 
  1217.         -min 0 -max 100
  1218.         -fmx  100000
  1219.         -step 1
  1220.         shatterSurfaceSeedValue;
  1221.  
  1222.     optionMenuGrp -l "Post Operation"
  1223.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1224.         shatterSurfacePostOperation;
  1225.         menuItem -l "shapes";
  1226. //        menuItem -l "rigid bodies";
  1227.         menuItem -l "rigid bodies with collisions off";
  1228. //        menuItem -l "soft bodies";
  1229.         menuItem -l "soft bodies with goals";
  1230. //        menuItem -l "soft bodies with lattice";
  1231.         menuItem -l "soft bodies with lattice and goals";
  1232.         menuItem -l "sets";
  1233.  
  1234.     checkBoxGrp -l "" -l1 "Triangulate Surface"
  1235.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1236.         -ncb 1
  1237.         shatterSurfaceTriangulate;
  1238.  
  1239.     checkBoxGrp -l "" -l1 "Smooth Shards"
  1240.         -ncb 1
  1241.         shatterSurfaceSmoothing;
  1242.  
  1243.     radioButtonGrp -l "Original Surface"
  1244.         -nrb 3 
  1245.         -l1 "Nothing"
  1246.         -l2 "Hide"
  1247.         -l3 "Delete"
  1248.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1249.         shatterSurfaceOriginal;
  1250.  
  1251.     radioButtonGrp -l ""
  1252.         -nrb 1 
  1253.         -scl shatterSurfaceOriginal
  1254.         -l1 "Link to Shards"
  1255.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1256.         shatterSurfaceOriginal1;
  1257.  
  1258.     checkBoxGrp -l "" -l1 "Make Original Surface Rigid"
  1259.         -ncb 1
  1260.         -en false
  1261.         shatterSurfaceMakeRigidBody;
  1262.  
  1263.     checkBoxGrp -l "" -l1 "Verbose Mode"
  1264.         -ncb 1
  1265.         shatterSurfaceVerbose;
  1266.  
  1267.     setParent ..;
  1268.  
  1269.     return $surfaceTab;
  1270. }
  1271.  
  1272.  
  1273. //  ====================== createSolidShatterTabLayout ======================
  1274. //
  1275. //  SYNOPSIS
  1276. //      Create a solid shatter clip effect option box layout.
  1277. //
  1278. //  INPUT ARGUMENTS
  1279. //        string $parent            the parent layout
  1280. //
  1281. global proc string createSolidShatterTabLayout( string $parent )
  1282. {
  1283.     // Solid Shatter Tab
  1284.     //
  1285.     string $solidTab = `rowColumnLayout -numberOfColumns 1 -cw 1 500 shatterSolidTab`;
  1286.  
  1287.     textFieldGrp -l "Solid Shatter Name" 
  1288.         shatterSolidName;
  1289.  
  1290.     intSliderGrp -l "Shard Count"
  1291.         -field true 
  1292.         -min 2 -max 10
  1293.         -fmx  10000
  1294.         -step 1
  1295.         shatterSolidShardCount;
  1296.  
  1297.     floatSliderGrp -l "Edge Jagginess"
  1298.         -field true 
  1299.         -min 0.0 -max 1.0
  1300.         shatterSolidEdgePerturbation;
  1301.  
  1302.     intSliderGrp -l "Seed Value"
  1303.         -field true 
  1304.         -min 0 -max 100
  1305.         -fmx  100000
  1306.         -step 1
  1307.         shatterSolidSeedValue;
  1308.  
  1309.     optionMenuGrp -l "Post Operation"
  1310.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1311.         shatterSolidPostOperation;
  1312.         menuItem -l "shapes";
  1313. //        menuItem -l "rigid bodies";
  1314.         menuItem -l "rigid bodies with collisions off";
  1315. //        menuItem -l "soft bodies";
  1316.         menuItem -l "soft bodies with goals";
  1317. //        menuItem -l "soft bodies with lattice";
  1318.         menuItem -l "soft bodies with lattice and goals";
  1319.  
  1320.     checkBoxGrp -l "" -l1 "Remove Interior Polygons"
  1321.         -ncb 1
  1322.         -v1 false
  1323.         -cc ("dynSolidShatterRemoveInteriorCB " + $parent)
  1324.         shatterSolidRemoveInterior;
  1325.  
  1326.     floatSliderGrp -l "Extrude Shards"
  1327.         -field true 
  1328.         -min -1.0
  1329.         -max  1.0
  1330.         -fmn -10000.0
  1331.         -fmx  10000.0
  1332.         -step 1
  1333.         -enable false
  1334.         shatterSolidExtrude;
  1335.  
  1336.     checkBoxGrp -l "" -l1 "Triangulate Surface"
  1337.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1338.         -ncb 1
  1339.         shatterSolidTriangulate;
  1340.  
  1341.     checkBoxGrp -l "" -l1 "Apply Interior Material"
  1342.         -ncb 1
  1343.         shatterSolidInteriorMaterial;
  1344.  
  1345.     radioButtonGrp -l "Original Surface"
  1346.         -nrb 3 
  1347.         -l1 "Nothing"
  1348.         -l2 "Hide"
  1349.         -l3 "Delete"
  1350.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1351.         shatterSolidOriginal;
  1352.  
  1353.     radioButtonGrp -l ""
  1354.         -nrb 1 
  1355.         -scl shatterSolidOriginal
  1356.         -l1 "Link to Shards"
  1357.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1358.         shatterSolidOriginal1;
  1359.  
  1360.     checkBoxGrp -l "" -l1 "Make Original Surface Rigid"
  1361.         -ncb 1
  1362.         -en false
  1363.         shatterSolidMakeRigidBody;
  1364.  
  1365.     checkBoxGrp -l "" -l1 "Verbose Mode"
  1366.         -ncb 1
  1367.         shatterSolidVerbose;
  1368.  
  1369.     setParent ..; 
  1370.  
  1371.     return $solidTab;
  1372. }
  1373.  
  1374.  
  1375. //  ====================== createCrackShatterTabLayout ======================
  1376. //
  1377. //  SYNOPSIS
  1378. //      Create a crack shatter clip effect option box layout.
  1379. //
  1380. //  INPUT ARGUMENTS
  1381. //        string $parent            the parent layout
  1382. //
  1383. global proc string createCrackShatterTabLayout( string $parent )
  1384. {
  1385.     // Crack Shatter Tab.
  1386.     //
  1387.     string $crackTab = `rowColumnLayout -numberOfColumns 1 -cw 1 600 shatterCrackTab`;
  1388.  
  1389.     textFieldGrp -l "Crack Shatter Name" 
  1390.         shatterCrackName;
  1391.  
  1392.     // Shatter Attributes Controls
  1393.     //
  1394.     intSliderGrp -l "Crack Count"
  1395.         -field true 
  1396.         -min 1 -max 10
  1397.         -fmn 0
  1398.         -fmx 10000
  1399.         -step 1
  1400.         shatterCrackCount;
  1401.  
  1402.     intSliderGrp -l "Crack Length"
  1403.         -field true 
  1404.         -min 1 -max 500
  1405.         -step 1
  1406.         shatterCrackLength;
  1407.  
  1408.     floatSliderGrp -l "Edge Jagginess"
  1409.         -field true 
  1410.         -min 0.0 -max 1.0
  1411.         shatterCrackEdgePerturbation;
  1412.  
  1413.     floatSliderGrp -l "Extrude Shards"
  1414.         -field true 
  1415.         -min -1.0
  1416.         -max  1.0
  1417.         -fmn -10000.0
  1418.         -fmx  10000.0
  1419.         -step 1
  1420.         shatterCrackExtrude;
  1421.  
  1422.     intSliderGrp -l "Seed Value"
  1423.         -field true 
  1424.         -min 0 -max 100
  1425.         -fmx  100000
  1426.         -step 1
  1427.         shatterCrackSeedValue;
  1428.  
  1429.     optionMenuGrp -l "Post Operation"
  1430.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1431.         shatterCrackPostOperation;
  1432.         menuItem -l "cracks on surface";
  1433.         menuItem -l "shapes";
  1434. //        menuItem -l "rigid bodies";
  1435.         menuItem -l "rigid bodies with collisions off";
  1436. //        menuItem -l "soft bodies";
  1437.         menuItem -l "soft bodies with goals";
  1438. //        menuItem -l "soft bodies with lattice";
  1439.         menuItem -l "soft bodies with lattice and goals";
  1440.         menuItem -l "sets";
  1441.  
  1442.     checkBoxGrp -l "" -l1 "Triangulate Surface"
  1443.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1444.         -ncb 1
  1445.         shatterCrackTriangulate;
  1446.  
  1447.     radioButtonGrp -l "Original Surface"
  1448.         -nrb 3 
  1449.         -l1 "Nothing"
  1450.         -l2 "Hide"
  1451.         -l3 "Delete"
  1452.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1453.         shatterCrackOriginal;
  1454.  
  1455.     radioButtonGrp -l ""
  1456.         -nrb 1 
  1457.         -scl shatterCrackOriginal
  1458.         -l1 "Link to Shards"
  1459.         -cc ("dynClipEffectsPostOperationCB " + $parent)
  1460.         shatterCrackOriginal1;
  1461.  
  1462.     checkBoxGrp -l "" -l1 "Make Original Surface Rigid"
  1463.         -en false
  1464.         -ncb 1
  1465.         shatterCrackMakeRigidBody;
  1466.  
  1467.     checkBoxGrp -l "" -l1 "Verbose Mode"
  1468.         -ncb 1
  1469.         shatterCrackVerbose;
  1470.  
  1471.     setParent ..; 
  1472.  
  1473.     return $crackTab;
  1474. }
  1475.  
  1476.  
  1477. //  ====================== dynClipEffectsPostOperationCB ======================
  1478. //
  1479. // Callback for the shatter effect post operation option menu.
  1480. // This callback prints an warning if the user does not have
  1481. // the tab button set when creating rigid bodies.
  1482. //
  1483. global proc dynClipEffectsPostOperationCB(string $parent)
  1484. {
  1485.     setParent $parent;
  1486.  
  1487.     int    $rigidBodyOption = false;
  1488.     int    $originalSurface = -1;
  1489.     string $triangulateValue;
  1490.     string $optionValue;
  1491.     
  1492.     string $shatterTypeValue = `tabLayout -q -selectTab shatterTabLayout`;
  1493.  
  1494.     if ( $shatterTypeValue == "shatterSurfaceTab" )
  1495.     {
  1496.         $optionValue      = `optionMenuGrp -q -v shatterSurfacePostOperation`;
  1497.         $triangulateValue = `checkBoxGrp -q -v1 shatterSurfaceTriangulate`;
  1498.         $originalSurface  = `radioButtonGrp -q -select shatterSurfaceOriginal`;
  1499.  
  1500.         if ( $originalSurface == 0 )
  1501.         {
  1502.             $originalSurface  = `radioButtonGrp -q -select shatterSurfaceOriginal1` + 3;
  1503.         }
  1504.     }
  1505.     else if ( $shatterTypeValue == "shatterSolidTab" )
  1506.     {
  1507.         $optionValue      = `optionMenuGrp -q -v shatterSolidPostOperation`;
  1508.         $triangulateValue = `checkBoxGrp -q -v1 shatterSolidTriangulate`;
  1509.         $originalSurface  = `radioButtonGrp -q -select shatterSolidOriginal`;
  1510.  
  1511.         if ( $originalSurface == 0 )
  1512.         {
  1513.             $originalSurface  = `radioButtonGrp -q -select shatterSolidOriginal1` + 3;
  1514.         }
  1515.     }
  1516.     else if ( $shatterTypeValue == "shatterCrackTab" )
  1517.     {
  1518.         $optionValue      = `optionMenuGrp -q -v shatterCrackPostOperation`;
  1519.         $triangulateValue = `checkBoxGrp -q -v1 shatterCrackTriangulate`;
  1520.         $originalSurface  = `radioButtonGrp -q -select shatterCrackOriginal`;
  1521.  
  1522.         if ( $originalSurface == 0 )
  1523.         {
  1524.             $originalSurface  = `radioButtonGrp -q -select shatterCrackOriginal1` + 3;
  1525.         }
  1526.     }
  1527.  
  1528.     if ( ($optionValue == "rigid bodies") || 
  1529.          ($optionValue == "rigid bodies with collisions off") )
  1530.     {
  1531.         $rigidBodyOption = true;
  1532.     }
  1533.  
  1534.     if ( ($triangulateValue == 0) && $rigidBodyOption )
  1535.     {
  1536.         warning( "Creating rigid bodies without triangulating the surface may cause interpenetration problems." );
  1537.     }
  1538.  
  1539.     if ( $originalSurface != 4 )
  1540.     {
  1541.         $rigidBodyOption = false;
  1542.     }
  1543.  
  1544.     if ( $shatterTypeValue == "shatterSurfaceTab" )
  1545.     {
  1546.            checkBoxGrp -e -enable $rigidBodyOption shatterSurfaceMakeRigidBody;
  1547.     }
  1548.     else if ( $shatterTypeValue == "shatterSolidTab" )
  1549.     {
  1550.            checkBoxGrp -e -enable $rigidBodyOption shatterSolidMakeRigidBody;
  1551.     }
  1552.        else if ( $shatterTypeValue == "shatterCrackTab" )
  1553.     {
  1554.            checkBoxGrp -e -enable $rigidBodyOption shatterCrackMakeRigidBody;
  1555.     }
  1556. }
  1557.  
  1558.  
  1559.  
  1560. //  ====================== dynSolidShatterRemoveInteriorCB ======================
  1561. //
  1562. // This callback enables/disables the extrude slider depending on the state
  1563. // of the remove interior check box.
  1564. //
  1565. //
  1566. global proc dynSolidShatterRemoveInteriorCB(string $parent)
  1567. {
  1568.     setParent $parent;
  1569.  
  1570.     string $triangulateValue;
  1571.     string $optionValue;
  1572.     
  1573.     int $removeInterior = `checkBoxGrp -q -v1 shatterSolidRemoveInterior`;
  1574.  
  1575.     if ( $removeInterior )
  1576.     {
  1577.         floatSliderGrp -e -enable true  shatterSolidExtrude;
  1578.         checkBoxGrp    -e -enable false shatterSolidInteriorMaterial;
  1579.     }
  1580.     else
  1581.     {
  1582.         floatSliderGrp -e -enable false shatterSolidExtrude;
  1583.         checkBoxGrp    -e -enable true  shatterSolidInteriorMaterial;
  1584.     }
  1585. }
  1586.  
  1587.  
  1588.  
  1589. //  ====================== dynClipEffectsShatterTabCB ======================
  1590. //
  1591. //  Sets the option var for the tab layout.
  1592. //
  1593. global proc dynClipEffectsShatterTabCB(string $parent)
  1594. {
  1595.     setParent $parent;
  1596.  
  1597.     string $shatterTypeValue = `tabLayout -q -selectTab shatterTabLayout`;
  1598.  
  1599.     optionVar -stringValue shatterType $shatterTypeValue;
  1600. }
  1601.  
  1602. //    Callback for the fireworks Random Firesorks checkbox.
  1603. //
  1604.  
  1605. global proc fwSparksSetUserColorProcCB (string $parent, int $isOn)
  1606. {
  1607.     // Enable/disable controls depending on the value of $isOn
  1608.     //
  1609.     setParent $parent;
  1610.  
  1611.     if ($isOn)
  1612.     {
  1613.         textFieldGrp -e -enable  true fwSparksColorCreationProc;
  1614.     }
  1615.     else
  1616.     {
  1617.         textFieldGrp -e -enable  false fwSparksColorCreationProc;
  1618.     }
  1619. }
  1620.  
  1621. global proc fwTrailSetUserColorProcCB (string $parent, int $isOn)
  1622. {
  1623.     // Enable/disable controls depending on the value of $isOn
  1624.     //
  1625.     setParent $parent;
  1626.  
  1627.     if ($isOn)
  1628.     {
  1629.         textFieldGrp -e -enable  true fwTrailColorCreationProc;
  1630.     }
  1631.     else
  1632.     {
  1633.         textFieldGrp -e -enable  false fwTrailColorCreationProc;
  1634.     }
  1635. }
  1636.